<div id="{{ elementName }}"></div>

<script>
    Morris.Donut({
        element: '{{ elementName }}',
        data: [
            {% set first = true %}
            {% for key,val in graphData %}
            {% if not first %},{% else %}{% set first = false %}{% endif %}{value: {{ val }}, label: '{{ key }}'}
            {% endfor %}
        ],
        {% if colors %}colors: {{ colors|raw }},{% endif %}
        formatter: function (x) { return {% if formatter %}'{{ formatter }}'+{% endif %}x }
    });
</script>
